import { FormProps, FormSchema } from '@/components/Table'
import { BasicColumn } from '@/components/Table/src/types/table'

// 套餐列表
export function getPackageBasicColumns(): BasicColumn[] {
  return [
    {
      title: '套餐编号',
      dataIndex: 'packageCode'
    },
    {
      title: '套餐名称',
      dataIndex: 'packageName'
    },
    {
      title: '套餐金额',
      align: 'right',
      width: 100,
      dataIndex: 'unitPrice'
    },
    {
      title: '缴款方式',
      width: 120,
      dataIndex: 'paymentMethod'
    },
    {
      title: '已售数量',
      align: 'right',
      width: 140,
      dataIndex: 'orderCount'
    },
    {
      title: '套餐状态',
      width: 140,
      dataIndex: 'packageStatus'
    },
    {
      title: '创建时间',
      width: 150,
      dataIndex: 'createTime'
    },
    {
      title: '操作',
      width: 144,
      dataIndex: 'operate'
    }
  ]
}

export function getSearchFormConfig(): Partial<FormProps> {
  return {
    labelWidth: 80,
    baseColProps: {
      span: 6,
      md: 10,
      xl: 8,
      xxl: 6
    },
    schemas: [
      {
        field: 'packageName',
        label: '套餐名称',
        component: 'Input'
      },
      {
        field: 'packageStatus',
        label: '套餐状态',
        component: 'Select',
        componentProps: {
          options: [
            {
              label: '已上架',
              value: '1',
              key: '1'
            },
            {
              label: '已下架',
              value: '2',
              key: '2'
            }
          ]
        }
      }
    ]
  }
}
